﻿/*
Copyright (c) 2010 Lance Ward
This software is licensed under the MIT license, except where otherwise noted.
For complete license details, refer to license.txt
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

namespace ADNTimeline
{
    class ImageCheckButton : CheckBox
    {
        private Image checkImage = null;
        private Image uncheckImage = null;

        public Image CheckedImage
        {
            get { return checkImage; }
            set { checkImage = value; }
        }

        public Image UncheckedImage
        {
            get { return uncheckImage; }
            set { uncheckImage = value; }
        }

        public ImageCheckButton()
        {
            this.Appearance = Appearance.Button;
        }

        protected override void OnCheckedChanged(EventArgs e)
        {
            base.OnCheckedChanged(e);
            if (this.CheckState == CheckState.Checked && CheckedImage != null)
            {
                this.Image = checkImage;
            }
            else if(uncheckImage != null)
            {
                this.Image = uncheckImage;
            }
        }
    }
}
